package lab2.text27;

import java.util.InputMismatchException;
import java.util.Scanner;

/**
 * Created by Administrator on 2017/11/2.
 */

public class Text {
    public static void main(String[] args) {
        int a=0;
        Scanner scanner=new Scanner(System.in);
        System.out.println("Please input an int:");
        try {
            a = scanner.nextInt();
        }catch(InputMismatchException e) {
            System.out.println("类型不匹配！！");
        }finally{
            System.out.println("a="+a);
        }
    }
}
//哪些代码可能会出错？-try{}
//会出什么错？-catch（）
//出了错如何处理-catch{}